package com.yidu.verycd_reception.diaoyong;

import com.yidu.verycd_reception.entity.VerycdComment;
import com.yidu.verycd_reception.entity.VerycdUser;
import com.yidu.verycd_reception.util.BaseMessage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

//backgroundMicroService
@Component
@FeignClient(name="BACKGROUNDMICROSERVICE")
public interface BackgroundClient {
    @RequestMapping(value="verycdUser/selectOne?id={id}")
    public VerycdUser findById(@PathVariable("id") Integer id);

    @RequestMapping(value = "verycdComment/findAll?page={page}&limit={limit}")
    public Map<String,Object> queryAllByLimit(@PathVariable("page") int page,@PathVariable("limit")int limit);

    @RequestMapping(value = "verycdComment/add?comContent={comContent}&comTime={comTime}&userId={userId}&movieId={movieId}")
    public BaseMessage insert( @PathVariable("comContent") String comContent, @PathVariable("comTime") String comTime, @PathVariable("userId") Integer userId, @PathVariable("movieId") Integer movieId );

    @RequestMapping(value = "verycdComment/delete?comId={comId}")
    public BaseMessage delete(@PathVariable("comId") Integer comId);

    @RequestMapping(value = "verycdUser/findAll?page={page}&limit={limit}&userName={userName}&userPhone={userPhone}")
    public Map<String,Object> fondAll(@PathVariable("page") int page, @PathVariable("limit") int limit,@PathVariable("userName") String userName,@PathVariable("userPhone")String userPhone);

    @RequestMapping(value = "verycdUser/deleteById?userId={userId}")
    public BaseMessage deleteById(@PathVariable("userId") int userId);

    @RequestMapping(value = "verycdUser/insertOrUpdate?userId={userId}&userName={userName}&userPwd={userPwd}&userSex={userSex}&userPhone={userPhone}")
    public BaseMessage insertOrUpdate(@PathVariable("userId") Integer userId,@PathVariable("userName") String userName,@PathVariable("userPwd") String userPwd,@PathVariable("userSex") String userSex,@PathVariable("userPhone") String userPhone );

    @RequestMapping(value = "verycdUser/selectOne?userId={userId}")
    public  VerycdUser selectOne(@PathVariable("userId") Integer userId);


    @RequestMapping(value = "verycdUser/dyRegist?userName={userName}&userPwd={userPwd}&userPhone={userPhone}")
    public BaseMessage dyRegist(@PathVariable("userName") String userName,@PathVariable("userPwd") String userPwd,@PathVariable("userPhone") String userPhone);

    @RequestMapping(value = "verycdUser/dyLogin?userName={userName}&userPwd={userPwd}")
    public BaseMessage dyLogin(@PathVariable("userName") String userName,@PathVariable("userPwd") String userPwd);


}
